<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ include file="../includes/common.jsp" %>

<c:choose>

<c:when test="${pageCount > 0}">
	<c:if test="${not empty message}"><c:if test="${not empty message}"><div class="notification">${message}</div></c:if></c:if>
	
	<form action="${scriptPath}" id="listForm">
	
	<jsp:include page="history.list-nav.jsp"></jsp:include>
	
	<table>
	<tr>
		<th>Đề thi</th>
		<th>Mã đề</th>
		<th>Ngày làm</th>
		<th>Thời gian làm</th>
		<th>Điểm</th>
	</tr>
	<c:forEach items="${histories}" var="history">
	<tr>
		<td><a href="${scriptPath}?action=history.view&id=${history.id}" 
				title="${history.test.description}">${history.test.name}</a></td>
		<td  align="center">${(empty history.version.code) ? "&lt;không tên&gt;" : history.version.code}</td>
	    <!-- 
		<td><a href="${scriptPath}?action=testversion.view&testid=${test.id}&verid=${version.id}"> 
	        ${(empty history.version.code) ? "&lt;không tên&gt;" : history.version.code}</a></td>
	     -->
		<td align="right">${u:formatDateTime(history.takenDate)}</td>
		<td align="right">${u:floor(history.time/60)}' 
	        <c:if test="${history.time%60 != 0}">${history.time%60}"</c:if></td>
		<td align="right">${u:round(history.mark*100)}%</td>
	</tr>
	</c:forEach>
	<tr>
	</tr>
	</table>
	
	<jsp:include page="history.list-nav.jsp"></jsp:include>
	
	</form>
</c:when>

<c:otherwise>
   <div class="empty-notif">
       Chưa có dữ liệu
   </div>
</c:otherwise>

</c:choose>

